package cn.net.shuxing.yifu.common.front.controller;//package cn.net.shuxing.yifu.common.front.controller;
//
//import cn.net.shuxing.yifu.common.bean.SystemMessage;
//import cn.net.shuxing.yifu.common.dto.BaseDto;
//import cn.net.shuxing.yifu.common.util.JedisUtil;
//import cn.net.shuxing.yifu.common.util.RedisKeyCreator;
//import com.alibaba.fastjson.JSON;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//import redis.clients.jedis.Jedis;
//
//import java.util.ArrayList;
//import java.util.List;
//
//@RestController
//public class SystemMessageController {
//
//    @Autowired
//    private JedisUtil jedisUtil;
//
//    @RequestMapping("/front/message")
//    public BaseDto getSystemMessages(Integer userId)
//    {
//        //Jedis //jedis = jedisUtil.getJedis();
//        List<String> systemMessageStrList = jedisUtil.lrange(RedisKeyCreator.systemMessage(userId), 0, -1);
//        List<SystemMessage> systemMessageList = new ArrayList<>(systemMessageStrList.size());
//        for (String systemMessageStr : systemMessageStrList)
//        {
//            SystemMessage systemMessage = JSON.parseObject(systemMessageStr, SystemMessage.class);
//            systemMessageList.add(systemMessage);
//        }
//        return BaseDto.ok(systemMessageList);
//    }
//}
